package routers

import (
	"awesomeProject1/微信登录demo/controller"
	"awesomeProject1/微信登录demo/middleware"
	"github.com/gin-gonic/gin"
)

func SetupRouters() *gin.Engine {
	r := gin.Default()
	r.Use(middleware.Cors)

	g := r.Group("/Aip")
	{
		g.POST("/getSessionKeyOrOpenid", controller.LoginHandel)
		g.POST("/getUserPhone", controller.GetUserPhoneHandler)
	}
	//给船老写的
	g1 := r.Group("/api")
	{
		g1.POST("/testIsCrossDomain", controller.TestIsCrossDomainHandel)
	}

	return r
}
